﻿<!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:sp="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.StartPage"
      xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0"
      xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
      xmlns:prj="clr-namespace:QuickSolutionStartPageControl;assembly=QuickSolutionStartPageControl"
      mc:Ignorable="d" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="600" d:DesignWidth="800">

    <Grid.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Microsoft.VisualStudio.Shell.StartPage;component/Styles/startpageresources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Grid.Resources>

    <Grid x:Name="LayoutRoot" Background="{DynamicResource {x:Static vsfx:VsBrushes.StartPageBackgroundKey}}" Style="{DynamicResource StartPage.OuterGridStyle}">

        <Grid.ColumnDefinitions>
            <!-- Left Hand Column -->
            <!-- This column is just wide enough to fit the Command Buttons and Start Page Options.
                 The Recent Project area is constrained to the width of the Commmand Buttons. -->
            <ColumnDefinition MinWidth="{Binding ElementName=commandButtonsGrid, Path=ActualWidth}" Width="3*" MaxWidth="330" />
            <!-- Gutter -->
            <ColumnDefinition Width="6"/>
            <!-- Allow main column to collapse to 0 -->
            <ColumnDefinition Width="7*" MinWidth="0"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <!-- Logo-->
            <RowDefinition Height="130" />
            <!-- Main Content Area -->
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--Logo Image -->
        <!--Note: To reference files relative to this XAML file, use syntax like the following: <Image Source="{sp:StartPageRelative myImage.png}" .../> -->
        <Image Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Source="{Binding Background.Logo}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1600" />

        <!--Left Column-->
        <Grid Width="Auto" Grid.Column="0" Grid.Row="1" Margin="15,-35,0,15" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <!-- Command Buttons for New Projects -->
                <RowDefinition Height="Auto"/>
                <!-- MRU Row -->
                <RowDefinition Height="*"/>
                <!--Gutter at bottom of page -->
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Command Buttons -->
            <Grid x:Name="commandButtonsGrid" MinWidth="270" Grid.Row="0" Margin="0,15,0,30" HorizontalAlignment="Left">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="3"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="3"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                
                <vs:ImageButton 
                    x:Uid="ConnectToTSButton"
                    Margin="15,2,15,2"
                    Width="Auto" 
                    Content="Connect To Team Foundation Server"
                    Visibility="{Binding Path=TeamFoundationClientSupported, Converter={StaticResource boolToVisibilityConverter}}"	
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static sp:VSCommands.ExecuteCommand}" CommandParameter="Team.ConnecttoTeamFoundationServer"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/ConnectToTFS.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/ConnectToTFSMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/ConnectToTFSMouseDown.png">
                </vs:ImageButton>

                <vs:ImageButton
                    Grid.Row="2"
                    x:Uid="NewProjectButton"
                    Margin="15,2,0,2"
                    Width="Auto" 
                    Content="New Project..."
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static sp:VSCommands.ExecuteCommand}" CommandParameter="File.NewProject"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/NewProject.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/NewProjectMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/NewProjectMouseDown.png">
                </vs:ImageButton>

                <vs:ImageButton
                    Grid.Row="4"
                    x:Uid="OpenProjectButton"
                    Margin="15,2,0,2"
                    Width="Auto"        
                    Content="Open Project..."
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static sp:VSCommands.ExecuteCommand}" CommandParameter="File.OpenProject"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/OpenProject.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/OpenProjectMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.StartPage;component/Images/StartPage/OpenProjectMouseDown.png">
                </vs:ImageButton>

            </Grid>
            
           
            <!-- Recent Projects Section -->
            <Grid Grid.Row="1" HorizontalAlignment="Left" Width="Auto">
                <Grid.RowDefinitions>
                    <!-- Heading -->
                    <RowDefinition Height="Auto" />
                    <!-- MRU Container -->
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <!-- Recent Projects Heading-->
                <StackPanel Grid.Row="0" Margin="0,0,0,10" Orientation="Horizontal">
                    <TextBlock Text="Recent Projects" VerticalAlignment="Top" Style="{DynamicResource StartPage.HeadingTextStyle}" x:Uid="RecentProjects"/>
                    <Path VerticalAlignment="Center" Margin="6,0,0,-4" Width="Auto" Height="1" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource {x:Static vsfx:VsBrushes.StartPageSeparatorKey}}" Data="F1 M 0.5,0.5L 199.5,0.5"/>
                </StackPanel>
                <!-- MRU List Container -->
                <ScrollViewer Grid.Row="1" HorizontalAlignment="Stretch" Style="{DynamicResource StartPage.ScrollViewerStyle}" VerticalAlignment="Stretch"  VerticalScrollBarVisibility="Auto">
                    <sp:MruListBox 
                        DataContext="{Binding RecentProjects}" 
                        ItemsSource="{Binding Path=Items}"
                        Background="Transparent"
                        BorderThickness="0"
                        AutomationProperties.AutomationId="MruList"/>
                </ScrollViewer>
            </Grid>

            <!-- Start Page Options -->
            <StackPanel Margin="0,5,0,0" Grid.Column="0" Grid.Row="2">
                <CheckBox x:Uid="AutoClose_Option" Content="Close page after project load" IsChecked="{Binding ClosePageOnOpenProject, Mode=TwoWay}" Margin="0,0,2,0"/>
                <CheckBox x:Uid="ShowOnStartUp_Option" Content="Show page on startup" IsChecked="{Binding ShowPageAtStartup, Mode=TwoWay}" Margin="0,2,0,0"/>
            </StackPanel>
        </Grid>

        <Grid Grid.Column="2" Grid.Row="1" Margin="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
        <prj:tabContainer Grid.Row="0"></prj:tabContainer>
        <prj:controlVersionLabel Grid.Row="1" HorizontalContentAlignment="Right" />
        </Grid>
    </Grid>
</Grid>
